package com.hx.strategy.pay;

import com.hx.strategy.pay.payport.PayStrategy;
import com.hx.strategy.pay.payport.Payment;

import java.math.BigDecimal;

/**
 * @author Huathy
 * @date 2021-08-31 21:28
 * @description
 */
public class Order {
    private String uid;
    private String oid;
    private BigDecimal amount;

    public Order(String uid, String oid, BigDecimal amount) {
        this.uid = uid;
        this.oid = oid;
        this.amount = amount;
    }

    public MsgRes pay(String payKey){
        Payment payment = PayStrategy.get(payKey);
        System.out.println("欢迎使用：" + payment.getNmae());
        System.out.println("交易金额：" + amount);
        return payment.pay(uid,amount);
    }
}
